# Definition for a binary tree node.
class TreeNode(object):
    def __init__(self, x):
        self.val = x
        self.left = None
        self.right = None

class Solution(object):
    def mergeTrees(self, t1, t2):
        """
        :type t1: TreeNode
        :type t2: TreeNode
        :rtype: TreeNode
        """
        if not t1 and not t2:
            return None
        if not t1 :
            return t2
        if not t2:
            return t1
        node = TreeNode(t1.val +t2.val)
        t1.left = self.mergeTrees(t1.left,t2.left)
        t1.right = self.mergeTrees(t1.right,t2.right)
        return node











        # node = t1
        # # a = t1.val + t2.val
        # t = TreeNode(t1.val+t2.val)
        # if t1.left and t2.left and t1.right and t2.right:
        #     t.left = TreeNode(self.mergeTrees(t1.left,t2.left))
        #     t.right = TreeNode(self.mergeTrees(t1.right,t2.right))
        # if t1.left and t2.left:
        #     t.left = TreeNode(self.mergeTrees(t1.left, t2.left))
        #     # t.right = TreeNode(self.mergeTrees(t1.right, t2.right))
        # if not t1 and t2:



